package com.example.demodatadruid.service;

import com.example.demodatadruid.Entity.Department;
import com.example.demodatadruid.dao.DepartmentDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentService {
    @Autowired(required = false)
    DepartmentDao departmentDao;

    public List<Department> getAllDepartments(){
        return departmentDao.getAllDepartments();
    }
    public Department getDepartmentById(Integer id){ return departmentDao.getDepartmentById(id);}
    public Integer addDepartment(Department department){return departmentDao.addDepartment(department);}

    public Integer updateDepartment(Department department){return departmentDao.updateDepartment(department);}

    public Integer deleteDepartment(Integer id){return departmentDao.deleteDepartmentById(id);}

}
